<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
	</head>

	<body>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/app.js"></script>
		<script type="text/javascript">
			mui.init()
		</script>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">认证</h1>
		</header>
		<div class="mui-content">
		<ul class="mui-table-view">
		        <li class="mui-table-view-cell" >
		            <a class="mui-navigate-right" >
		               <span id="personal_name">实名认证</span><span id="personal"class="mui-badge mui-badge-success" style="background:#A6A6A6"></span>
		            </a>
		        </li>

		        <li class="mui-table-view-cell">
		            <a class="mui-navigate-right">
		                <span id="company_name">企业认证(仅限实名用户申请)</span><span id="company" class="mui-badge mui-badge-success" style="background:#A6A6A6"></span>
		            </a>
		        </li>
		        <!--<li class="mui-table-view-cell">
		            <a class="mui-navigate-right">
		                 银行卡认证<span id="bankcard" class="mui-badge mui-badge-success" onclick="goto('user','admin','authentication')" style="background:#A6A6A6">去认证</span>
		            </a>
		        </li>-->
		    </ul>		    
		</div>

	</body>
	<script src="../js/auth.js"></script>
<script>
		window.addEventListener('refresh', function(e){
			  location.reload(); //刷新
			});
			//企业认证状态
			auth2=function(result){
			  	var company=document.getElementById('company');
			  	var company_name=document.getElementById('company_name');
			  	if(result.state && result.state=='-1'){
////				alert(data);
				company.innerHTML='<span  onclick="goto(\'user\',\'admin\',\'auth_company\')">未通过/重新提交</span>';
				company.style.backgroundColor='red';
			}else if(result.state && result.state=='0'){
				company.innerHTML='待审核';
				company.style.backgroundColor='#A6A6A6';
			}else if(result.state && result.state=='1'){
				company.innerHTML='已认证';
				company_name.innerHTML=result.name;
				company.style.backgroundColor='#00EE76';
			}else{
				
			}
//			  	alert(result);
			};
			 //实名认证状态
			 auth1=function(result){
			  	var personal=document.getElementById('personal');
			  	var personal_name=document.getElementById('personal_name');
//			  	var result=JSON.stringify(e);
			  				if(result.state && result.state=='-1'){
//				alert(data);
				personal.innerHTML='<span  onclick="goto(\'user\',\'admin\',\'auth_id\')">未通过/重新提交</span>';
				personal.style.backgroundColor='red';
			}else if(result.state && result.state=='0'){
				personal.innerHTML='待审核';
				personal.style.backgroundColor='#A6A6A6';
			}else if(result.state && result.state=='1'){
				personal.innerHTML='已认证';
				personal_name.innerHTML=result.name;
				personal.style.backgroundColor='#00EE76';
				company(auth2);//获取企业认证状态
			}else{
				
			}
			};
			personal(auth1);//获取实名认证状态

</script>
</html>